package com.naire.modul.employee.service;

import net.common.manager.SystemCodeManager;
import net.common.service.GeneralService;
import com.naire.modul.employee.dao.EmployeeDao;
import com.naire.modul.employee.dao.impl.EmployeeDaoImpl;
import com.naire.modul.employee.vo.EmployeeVo;

/**
 * 
 * 
 * @author Administrator
 * 
 */
public class EmployeeEditorService extends GeneralService {

	private EmployeeVo bean;
	private Integer dept_id;

	@Override
	public void execute() throws Exception {
		EmployeeDao dao = new EmployeeDaoImpl();
		if (bean.getEmpl_id() != null) {
			dao.update(bean);
		} else {
			bean.setFlag(0);
			bean.setDept_id(dept_id);
			bean.setEmpl_num(SystemCodeManager.createCode("0006"));
			dao.insert(bean);
		}
	}

	public void setBean(EmployeeVo bean) {
		this.bean = bean;
	}

	public void setDept_id(Integer dept_id) {
		this.dept_id = dept_id;
	}

}
